package com.mz.ozy.mvp.presenter;


import android.app.Activity;

import com.mz.ozy.base.BasePresenterImpl;
import com.mz.ozy.bean.UsdtDetailBean;
import com.mz.ozy.mvp.model.UsdtDetailModel;
import com.mz.ozy.mvp.view.UsdtDetailContract;
import com.mz.ozy.net.MyObserver;
import com.mz.ozy.utils.RxUtil;

import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class UsdtDetailPresenter extends BasePresenterImpl<UsdtDetailContract.View> implements UsdtDetailContract.Presenter {

    private UsdtDetailModel mModel;

    public UsdtDetailPresenter() {
        mModel = new UsdtDetailModel();
    }


    @Override
    public void getUsdtDetail(Activity activity, String type, String pageNo, boolean b) {
        mModel.getUsdtDetail(activity, type, pageNo)
                .compose(RxUtil.rxSchedulerHelper(mView.<ResponseBody>bindToLifecycle()))
                .subscribe(new MyObserver<UsdtDetailBean>(mView, b) {
                    @Override
                    public void onSuccesss(UsdtDetailBean bean) {
                        mView.getUsdtDetailSuccess(bean);
                    }
                });
    }
}
